﻿<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="__STATICW__css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="__STATICW__css/H-ui.login.css" rel="stylesheet" type="text/css" />
<link href="__STATICW__css/style.css" rel="stylesheet" type="text/css" />
<link href="__STATICW__css/iconfont.css" rel="stylesheet" type="text/css" />

<title>铭代码crm登录</title>

</head>
<body>
  <div class="loginWraper">
    <div id="loginform" class="loginBox">
      <form class="form form-horizontal" action="{:url('admin/login/login')}" method="post">
        <div class="row cl">
          <label class="form-label col-xs-3"><i class="icon Hui-iconfont">&#xe60d;</i></label>
          <div class="formControls col-xs-8">
            <input id="username" name="u_name" type="text" placeholder="用户名只能中英文，数字，下划线，减号!" class="input-text size-L">
          </div>
        </div>

        <div class="row cl">
          <label class="form-label col-xs-3"><i class="icon Hui-iconfont">&#xe63f;</i></label>
          <div class="formControls col-xs-8">
            <input id="password" name="u_password" type="password" placeholder="以字母开头，长度在6-18之间，只能包含字符、数字和下划线。" class="input-text size-L">
          </div>
        </div>

        <div class="row cl">
          <div class="formControls col-xs-8 col-xs-offset-3">
             <input class="input-text size-L" type="text" placeholder="验证码"  value="验证码:" name="yzm" style="width:150px;">
             <img src="{:captcha_src()}" id="verify_img" width="95px" height="41px" onclick="this.src='{:captcha_src()}'">
          </div>
        </div>

        <div class="row cl">
          <div class="formControls col-xs-8 col-xs-offset-3">
            <input name="" type="submit" style="background:#47a4e1;" class="btn btn-success radius size-L" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
            <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;">
          </div>
        </div>

      </form>
    </div>
  </div>
<script type="text/javascript" src="_ADMIN_js/jquery.min.js"></script> 

    <script>
//        <!--用户名验证-->
         var op=false;
        $("#username").change(function(){
            var name=$("#username").val().trim();
            if(name.length>0&&name.length<=18){
                var reg=/^[\u4e00-\u9fa5A-Za-z0-9-_]*$/;
                if(!reg.test(name)){
                    op=false
                    $("#login").attr("disabled","disabled");
                    alert("用户名只能中英文，数字，下划线，减号!");//请将“字符串类型”要换成你要验证的那个属性名称！
                }
                else{
                    op=true;
                    $("#login").removeAttr("disabled");
                }
            }else{
                $("#login").attr("disabled","disabled");
                alert("用户名不能为空，并且长度不能超过18位");
            }
        });

//        密码验证
        $("#password").change(function(){
            var pass=$("#password").val().trim();
            if(pass.length>=6&&pass.length<=18){
                var reg1=/^[a-zA-Z]\w{5,17}$/;
                if(!reg1.test(pass)){
                    op=false
                    $("#login").attr("disabled","disabled");
                    alert("以字母开头，长度在6-18之间，只能包含字符、数字和下划线。 ");//请将“字符串类型”要换成你要验证的那个属性名称！
                }else{
                    op=true;
                    $("#login").removeAttr("disabled");
                }
            }else{
                op=false;
                $("#login").attr("disabled","disabled");
                alert("密码长度在6-18之间！")
            }
        });
        function islogin(){
            aleert(op);
            $("#login").removeAttr("disabled");
            if($("#password").val()==""||$("#username").val()==""){
                alert("用户名或密码不能为空");
            }else{
                if(op==false){
                    $("#login").attr("disabled","disabled");
                    alert("请按要求填写！")
                }else{
                    $("#login").removeAttr("disabled");
                }
            }
        }
    </script>
</body>
</html>